<?php

namespace app\index\model;

use think\Model;
use app\index\model\Attachment as AttachmentModel;

/**
 * 分类
 */
class Type extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = '__GOODS_TYPE__';

    //查询
    public static function getAll($map = [], $order = ''){

    	$data_list  = self::where($map)->order($order)->select();
    	foreach ($data_list as $key => $value) {
    		$data_list[$key]['thumb'] = AttachmentModel::where('id', $value['thumb'])->value('path');
    	}
    	
    	return $data_list;
    }
    
}